﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Movies
{
    public partial class FormNameInputWin : Form
    {
        public FormNameInputWin(bool normalMode)
        {
            InitializeComponent();
            if (normalMode)
            {
                okButton.Text = "Save";
                notInterestedButton.Visible = false;
            }
        }

        private void okButton_Click(object sender, EventArgs e)
        {
            HelperSettingProvider.Default().FirstName = firstName.Text.Trim();
            HelperSettingProvider.Default().LastName = lastName.Text.Trim();
            HelperSettingProvider.Default().NickName = nickName.Text.Trim();
            HelperSettingProvider.Default().Save();
            this.Dispose();
        }

        private void NameWindow_Load(object sender, EventArgs e)
        {
            HelperSettingProvider.SettingLocation(Properties.Settings.Default.dataStoreLocation + "\\AppData");

            firstName.Text = HelperSettingProvider.Default().FirstName;
            lastName.Text = HelperSettingProvider.Default().LastName;
            nickName.Text = HelperSettingProvider.Default().NickName;

        }

        private void notInterestedButton_Click(object sender, EventArgs e)
        {
            HelperSettingProvider.Default().NameChangeInterest = "false";
            HelperSettingProvider.Default().Save();
            this.Dispose();
        }
    }
}
